// 图表千分位
export const thousandSeparator = num => {
  return (
    num &&
    (num.toString().indexOf('.') !== -1
      ? num.toString().replace(/(\d)(?=(\d{3})+\.)/g, function($1, $2) {
          return $2 + ','
        })
      : num.toString().replace(/(\d)(?=(\d{3})+\b)/g, function($1, $2) {
          return $2 + ','
        }))
  )
}
